package cn.doitedu.rest.api.controller;

import cn.doitedu.rest.api.beans.UvBean;
import cn.doitedu.rest.api.service.AService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UvController {

    @Autowired
    AService aService;

    @RequestMapping("/uv/getuv/{dt}")
    public String getUvAmt(@PathVariable String dt){
        int uv = aService.getUvAmount(dt);
        return  dt+":"+uv;
    }

    @RequestMapping("/uv/add/{a}/{b}")
    public String getUvAmt(@PathVariable Integer a,@PathVariable Integer b){
        int add = aService.add(a, b);
        return a+"+"+b+"="+add;
    }

    @RequestMapping("/uv/pc_uv")
    public List<UvBean> getUvProvinceAndCity(String dt){
        List<UvBean> uvLst = aService.getUvProvinceAndCity(dt);
        return uvLst;
    }

}
